/**
 * 
 */
package mdb.com.vn.web.view;

import java.io.Serializable;
import java.util.List;

import javax.faces.model.ListDataModel;

import mdb.com.vn.model.CardSms;

import org.primefaces.model.SelectableDataModel;

/**
 * @author tu.dod
 *
 */

public class CardSmsDataModel extends ListDataModel<CardSms> implements
SelectableDataModel<CardSms>, Serializable {

/**
* 
*/
private static final long serialVersionUID = 1L;

public CardSmsDataModel() {
}
public CardSmsDataModel(List<CardSms> loansData) {
super(loansData);
}

@SuppressWarnings("unchecked")
@Override
public CardSms getRowData(String rowKey) {
// TODO Auto-generated method stub
List<CardSms> ibsms = (List<CardSms>) getWrappedData();
for (CardSms bankingSms : ibsms) {
	if (String.valueOf(bankingSms.getId()).equals(rowKey)){
		return bankingSms;
	}
}
return null;
}

@Override
public Object getRowKey(CardSms ibsms) {
// TODO Auto-generated method stub
return ibsms.getId();
}

}
